<?php
    $cnt = count($recentlybooked);
    if ($cnt > 4)
        $cnt = 4;
?>
<ul class="recentlyBooked">
    <?php
        for ($i = 0; $i < $cnt; $i++):
            $obj_name = URLify::filter($recentlybooked[$i]->object_name);
            $href = lang_url('accommodation/' . $obj_name . '-' . $recentlybooked[$i]->object_ID . '?preview=1&room_id=' . $recentlybooked[$i]->rooms[0]->room_ID) . lcu();
            ?>
            <li>
                <? $thumbnail = HOST_URL_HOTELS . $recentlybooked[$i]->photo_path . '/thumb_70x70/' . $recentlybooked[$i]->photo_name; ?>
                <? $thumbnail_preview = HOST_URL_HOTELS . $recentlybooked[$i]->photo_path . '/thumb_300x178/' . $recentlybooked[$i]->photo_name; ?>
                <a href="<?= $href ?>" class="clearfix recentlyLatest HoverImg" data-id="<?= $thumbnail_preview ?>" title="<?= str_replace("- Montenegro", "", $recentlybooked[$i]->object_name) ?>">
                    <div class="row">
                        <div class="span1"><img src="<?= $thumbnail ?>" alt="<?= $recentlybooked[$i]->photo_title ?>" class="img-rounded"  /></div>
                        <div class="span3">
                            <h3 class="ellipsis"><?= str_replace("- Montenegro", "", $recentlybooked[$i]->object_name) ?></h3>
                            <p class="ellipsis"><?= $recentlybooked[$i]->destination_name ?></p>
                            <div class="latest"><?= date('d.m.Y H:i', $recentlybooked[$i]->reservation->creation_date) ?>h</div>
                        </div>
                    </div>
                </a>

            </li>
        <?php endfor; ?> 
</ul>